package com.demo.instance;

import java.util.Calendar;
import java.util.Timer;

/**
 * FileName: TimerTest.java
 * 类的详细说明
 *
 * @author Pretty_Boy
 * @version 1.00
 * @Date 2018/9/2915:02
 */
public class TimerTest {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        Timer timer = new Timer();
        DancingRobot dancingRobot = new DancingRobot();
        WaterRobot waterRobot = new WaterRobot(timer);
        timer.schedule(dancingRobot,calendar.getTime(),2000L);
        timer.scheduleAtFixedRate(waterRobot,calendar.getTime(),2000L);

    }
}
